package rollUpGroup
{
	import mx.controls.Alert;
	import mx.controls.Label;
	import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
	import mx.events.FlexEvent;
	
	public class CustomColor extends Label
	{
		private const POSITIVE_COLOR:uint = 0x000000; // Black
		private const NEGATIVE_COLOR:uint = 0xFF0000; // Red
		
		public function CustomColor()
		{
			super();
			this.addEventListener(FlexEvent.DATA_CHANGE, onDataChange);
			
		}
		
		public function onDataChange(event:FlexEvent){
			var obj1:Object=AdvancedDataGridListData(listData).item;
//			Alert.show("file : " + obj1.rollUpGroupCode);
			if(obj1.flags == "Y"){
				setStyle("color", NEGATIVE_COLOR);
				setStyle("fontSize", 16);
			}else{
				setStyle("color", POSITIVE_COLOR);
				setStyle("fontSize", 14);
			}
		}
	}
}
